#include <stdio.h>
#include <math.h>

int main()
{
    char card1[4];
    char card2[4];
    char card3[4];
    int val1;
    int val2;
    int val3;
    int sum;

  
  printf("Let's play the game about 21 points，\n");

  printf("please input the first poker number  \n"); 
  scanf("%s",card1);
  
  switch(card1[0])
  {
      case'J':
      case'j':
      case'Q':
      case'q':
      case'K':
      case'k':
         val1=10;
      break;
       case'A':
         val1=11;
      break;
      default:
      val1=atoi(card1);
  }

  printf("This poker %s value is %d \n",card1,val1);
  
  printf("please input the second poker number \n");
  scanf("%s",card2);
 switch(card2[0])
  {
      case'J':
      case'j':
      case'Q':
      case'q':
      case'K':
      case'k':
         val2=10;
      break;
       case'A':
         val2=11;
      break;
      default:
      val2=atoi(card2);
  }
  printf("This poker %s value is %d \n",card2,val2);

  printf ("please input the third poker number  \n");
  scanf("%s",card3);
 switch(card3[0])
  {
      case'J':
      case'j':
      case'Q':
      case'q':
      case'K':
      case'k':
         val3=10;
      break;
       case'A':
         val3=11;
      break;
      default:
      val3=atoi(card3);
  }
printf("This poker %s value is %d \n",card3,val3);
 
  sum = val1 + val2 + val3 ;
 
  if(sum <=21)
    printf("Your scores in this game are %d ,\n WIN",sum);
 else if(val1==11||val2==11||val3 ==11)
   { sum=sum-10;
    printf("When A is 1,your scores in this game are %d ,\n WIN",sum);
    }
 else
    printf("LOSE GAME");

    return 0;
}